package com.ansion.utils.permission;

import androidx.annotation.NonNull;

//import com.google.auto.value.AutoValue;
final class AutoValue_Permission extends Permission {

    private final String name;
    private final State state;

    AutoValue_Permission(String name, State state) {
        if (name == null) {
            throw new NullPointerException("Null name");
        } else {
            this.name = name;
            if (state == null) {
                throw new NullPointerException("Null state");
            } else {
                this.state = state;
            }
        }
    }

    @NonNull
    public String name() {
        return this.name;
    }

    @NonNull
    public State state() {
        return this.state;
    }

    public String toString() {
        return "Permission{name=" + this.name + ", state=" + this.state + "}";
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Permission)) {
            return false;
        } else {
            Permission that = (Permission)o;
            return this.name.equals(that.name()) && this.state.equals(that.state());
        }
    }

    public int hashCode() {
        int h$ = 1;
        h$ = h$ * 1000003;
        h$ ^= this.name.hashCode();
        h$ *= 1000003;
        h$ ^= this.state.hashCode();
        return h$;
    }
}

